import java.util.Scanner;

public class Sing {
    public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            while (sc.hasNext()) {
                //总人数
                int n = sc.nextInt();
                //学生能力值数组，第i个人直接对应arr[i]
                int[] arr = new int[n + 1];
                //初始化
                for (int i = 1; i <= n; i++) {//人直接对应坐标
                    arr[i] = sc.nextInt();
                }
                //选择的学生数
                int kk = sc.nextInt();
                //间距
                int dd = sc.nextInt();

                output(n,arr,kk,dd);
            }
        }

        private static void output(int n, int[] arr, int kk, int dd) {

            long[][] f = new long[n + 1][kk + 1];//人直接对应坐标,n和kk都要+1
            long[][] g = new long[n + 1][kk + 1];
            //初始化k=1的情况
            for (int one = 1; one <= n; one++) {
                f[one][1] = arr[one];
                g[one][1] = arr[one];
            }
            for (int k = 2; k <= kk; k++) {
                for (int one = k; one <= n; one++) {   //选k个人时，第k个人所有可能的位置
                    f[one][k] = Long.MIN_VALUE;
                    g[one][k] = Long.MAX_VALUE;
                    for (int left = Math.max(k - 1, one - dd); left <= one - 1; left++) {  //第k-1个人的所有可能位置【既要保证间隔满足条件，又要保证第k-1个人前面还有k-2个人可选】
                        f[one][k] = Math.max(f[one][k], Math.max(f[left][k - 1] * arr[one], g[left][k - 1] * arr[one]));
                        g[one][k] = Math.min(g[one][k], Math.min(f[left][k - 1] * arr[one], g[left][k - 1] * arr[one]));
                    }
                }
            }
            long result = Long.MIN_VALUE;
            for (int one = kk; one <= n; one++) {
                if (result < f[one][kk]) {
                    result = f[one][kk];
                }
            }
            System.out.println(result);
    }
}

